var $ = require('../../common/helper.js');
Page({
	data: {
		name: '',
		rs: [],
		total_price: 0,
		total: 0,
		gjj_total: 0,
		person_total: 0,
		firm_total: 0,
		gjj_money: 0
	},
	onLoad: function (options) {
		console.log(options);
		if (typeof (options.casy_id) == 'undefined' || !options.casy_id.length) {
			$.overloadError('请先选择参保方案');
			wx.navigateBack();
			return;
		}
		var _this = this;
		$.get('api.php?app=cart&act=casy_detail&casy_id=' + options.casy_id + '&gjj=' + options.gjj, function (json) {
			_this.setData({
				name: json.data.name,
				rs: json.data.rs,
				total_price: json.data.total_price,
				total: json.data.total,
				gjj_total: json.data.gjj_total,
				person_total: json.data.person_total,
				firm_total: json.data.firm_total
			});
		});
	}
})